package com.amado.course07Array;

import java.util.Scanner;

public class ArrayDelete {
	public static void main(String[] args) {
		// 10个数组
		int[] array = {1,22,43,4,34,5,9,21,3,10};

		boolean isFindIndex= false;
		Scanner sc = new Scanner(System.in);
		System.out.println("请你要删除的整数：");
		int delteValue= sc.nextInt();
		for (int i = 0; i < array.length; i++) {
			//匹配
			if(delteValue==array[i]){
				isFindIndex = true;
			}
			//已经找到下标
			if(isFindIndex){
				if (i==array.length-1) {
					array[i]=0;
				}else{
					array[i] = array[i+1];
				}
			}
			System.out.print(array[i]+" ");
		}
	}
}
